package cn.opopopo.design_pattern_learn.结构型.facade;

// 外观类：提供简单接口
class Computer {
    private CPU cpu;
    private Memory memory;
    private HardDrive hardDrive;

    public Computer() {
        this.cpu = new CPU();
        this.memory = new Memory();
        this.hardDrive = new HardDrive();
    }

    // 高层接口：一键启动
    public void start() {
        System.out.println("开始启动电脑...");
        cpu.freeze();
        byte[] data = hardDrive.read(0, 1024);
        memory.load(0, data);
        cpu.jump(0);
        cpu.execute();
        System.out.println("电脑启动完成！");
    }
}